\chapter{Grid Application Management}
\label{Grid Application Management}

The term grid computing was coined by Foster and Kesselman in late 90's as a
hardware and software infrastructure that provides dependable, consistent,
pervasive, and inexpensive access to high-end computational capabilities. 

Nowadays, grid computing efforts can be seen as the third phase of metacomputing
evolution as stated in the Meta-computing's paper of Smarr and Catlett in 1992: a
transparent network that will increase the computational and information
resources available to an application. It is also a synonym of metasystem which
``supports the illusion of a single machine by transparently scheduling
application components on processors; managing data migration, caching, transfer,
and the masking of data-format differences between systems; detecting and
managing faults; and ensuring that users's data and physical resources are
protected, while scaling appropriately''. \cite{vargas:2004}


\section{Appman - Case Study}\label{Case Study}

Appman is a Java implementation of the GRAND model detiled by
\citet{vargas:2006}. GRAND (Grid Robust Application Deployment) is a model of hierarchical application management in grid environment. Its
objective is to deal with scalable form of submission and monitoring of
applications that execute a great number of tasks (hundreds or thousand) 
\cite{vargas:2005}.


\begin{figure}[ht] \centering \includegraphics[scale=0.4,bb=0 0 960
720]{img/GRANDModel.png}
\caption{GRAND Model: Architecture}
\label{fig:GRANDModel}
Source: \cite{vargas:2005}
\end{figure}

In this context, Appman \cite{vargas:2005} implements the submission control
(Submission Manager) and execution (Task Manager) of applications using the Java
language and EXEHDA system \cite{YaminASRFG05}. The EXEHDA (Execution Environment
for High Distributed Applications) \cite{YaminASRFG05} facilitates the
implementation and execution of distributed applications. Appman is implemented
in Java to allow portability. It uses the JavaCC tool to implement the
GRID-ADL parsing and interpretation. GRID-ADL is the application description language 
proposed in GRAND project. The Appman runtime environment uses the
services provided by EXEHDA middleware that allows remote execution and
monitoring. EXEHDA, which stands for ``Execution Environment for Highly
Distributed Applications'', has facilities to instantiate remote objects and to
coordinate their operation, as well as an integrated monitoring architecture.

Appman implements the basic main features of GRAND, including distributed task
submission and application monitoring, while giving feedback to the user. Figure
\ref{fig:GRANDModel} shows how Appman runs on a grid environment. One instance of
Appman and ISAM/EXEHDA needs to be present in every node of the grid. Every
machine can submit or run tasks. Users must provide input files in a web server.
Step 1 in Figure \ref{fig:GRANDModel} represents the user submitting a
description file which is parsed. The application graph is built in memory and
the Application Manager (AM) is started. Then, the Application Manager clusters
the application graph, instantiates Submission Managers (SM in step 2), and
distributes some subgraphs to the SMs. Input files and the executable are fetched
from a web server (step 3). In its current version, Appman requires that the user
indicates the machines where the Submission Managers will run. With this
simplification, a new Submission Manager is instantiated for each application in
each machine specified. After creating the SMs, the Application Manager as signs
subgraphs to each SM. The SMs report to the AM the tasks progress. Each SM,
independently, checks the list of available machines and randomly chooses where
to run. Immediately a TM is instantiated, which creates the remote task and
monitors it until it successfully completes. Before starting the execution of a
task, Appman transfers all input files specified in the GRID-ADL description to a
temporary directory in the remote machine where the task will be executed, a sort
of sand-box. Each task is only allowed to produce output files int this particular
temporart directory. The file transfer is performed automatically, but the user must make
the files available in an http accessible area, as mentioned before. Then, each 
SM gather updated information about available nodes through the EXEHDA information 
service. Each SM chooses where to run its tasks and instantiates TMs to
allocate the remote tasks (step 4). 

An graphical interface for online monitoring provides visual execution feedback to users. It runs independent from
execution, reading the log files. By using this tool, the user can have an idea
of the application execution progress. As the user will probably be running
experiments for days or weeks, this becomes a very important and essential tool.

